package com.lrkj.back.service.impl;

import java.util.List;
import java.util.Map;

import com.lrkj.back.entity.ZsWupinFafang;
import com.lrkj.back.service.ZsWupinFafangService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lrkj.back.mapper.ZsWupinFafangMapper;
import cn.com.cbons.mamisay.parent.db.api.DBInterface;
import cn.com.cbons.mamisay.parent.exception.DBException;
import cn.com.cbons.mamisay.parent.service.base.ParentServiceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Transactional
@Service
public class ZsWupinFafangServiceImpl extends ParentServiceImpl<ZsWupinFafang> implements ZsWupinFafangService {
    @Autowired
    private ZsWupinFafangMapper wupingmapper;

    @Override
    protected DBInterface<ZsWupinFafang> getDao() throws DBException {
        return wupingmapper;
    }

    @Override
    // ZsDabao这个参数要根据实际 的改
    public PageInfo<ZsWupinFafang> findAllfafangwuping(Map<String, Object> map) throws DBException {
        PageHelper.startPage(Integer.valueOf(map.get("pageNo").toString()),
                Integer.valueOf(map.get("pageSize").toString()));
        List<ZsWupinFafang> tbList = wupingmapper.findAllfafangwuping(map);
        PageInfo<ZsWupinFafang> page = new PageInfo<ZsWupinFafang>(tbList);
        return page;
    }

    @Override
    public void batchDelete(List<String> list) throws DBException {
        // TODO Auto-generated method stub
        wupingmapper.batchDelete(list);
    }

    public List<ZsWupinFafang> findAllfafangwupingNopage(Map<String, Object> map) throws DBException {
        return wupingmapper.findAllfafangwuping(map);
    }

}